<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/modules/cms/front/include/taglib.jsp" %>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>找回密码</title>
    <link href="${ctxStatic}/merchant/css/layui.css" rel="stylesheet">
    <link href="${ctxStatic}/merchant/css/index.css" rel="stylesheet" type="text/css">
    <link href="${ctxStatic}/merchant/css/pwd/forgetPassword.css" rel="stylesheet" type="text/css">
    <!--layui插件-->
    <script src="${ctxStatic}/merchant/js/jquery-3.3.1.min.js"></script>
    <!-- 表单验证插件 -->
    <script src="${ctxStatic}/merchant/js/Validform_v5.3.2.js"></script>
    <style type="text/css">
        #getCode[disabled] {
            color: #999;
            cursor: not-allowed;
        }

        .next > input {
            cursor: pointer;
        }

    </style>
</head>
<body>
<header>
    <div class="forgetPassword-title">
        <span>找回密码</span>
    </div>
</header>
<div class="forgetPassword">
    <form id="forgetPwd" action="${ctx}/goUserForgetPassword" method="post">
        <div class="forget">
            <div id="re" style="display: none;">
                <font color="red"></font>
            </div>
            <div class="tel">
                <input id="loginName" name="loginName" datatype="m" type="text" placeholder="请输入手机号">
            </div>
            <div class="Validform_checktip"></div>
            <div class="code">
                <sys:validateCode name="validateCode"
                                  inputCssStyle="margin-bottom:0;width: 169px; height: 48px; border: 1px solid #ccc; border-radius: 5px; padding-left: 14px;font-size: 16px;"
                />
            </div>

            <div class="code">
                <input type="text" id="code" name="code" datatype="*" placeholder="请输入短信验证码">
                <input id="getCode" type="button" value="获取验证码">
            </div>
            <div class="Validform_checktip"></div>
            <div class="next">
                <input id="go" type="submit" value="下一步">
            </div>
        </div>
    </form>
</div>
<footer class="foot">
		<span>
			Copyright 2017-2018 lexiaozhuan.com 版权所有 (京ICP证030173号
		</span>
    <img src="${ctxStatic}/merchant/images/shouye/ghs.png">
    <span>
			京公网安备11000002000001号)
		</span>
</footer>
</body>
<script>


    //获取验证码
    $("#getCode").click(function () {
        var phone = $("#loginName").val();
        var validateCode = $("#validateCode").val();
        $.post("${ctx}/yzm", {validateCode: validateCode, phone: phone}, function (result) {
            if (result.status == 0) {
                // $.jBox.alert("发送验证码成功");
                $("#re").html('');
                $("#re").html('<font color="red">验证码获取成功!</font>');
                $("#re").show();
                $('#phone').attr('readonly', "true");
            }
            else {
                $("#re").html('');
                $("#re").html('<font color="red">验证码获取失败，请您稍后重试!</font>');
                $("#re").show();
                // $.jBox.alert("发送验证码失败");
            }
        });
    });


    $("#forgetPwd").Validform({
        tiptype: 2,
        ajaxPost: false
    });

    $("#getCode").click(function () {
        $(this).attr('disabled', true);
        var time;
        clearInterval(time);
        var s = 60;
        var time = setInterval(function () {
            if (s > 0) {
                s--;
                $("#getCode").val(s + "s");
            } else {
                $("#getCode").removeAttr('disabled');
                $("#getCode").val('获取验证码');

            }

        }, 1000);

    })
</script>
</html>
